#pragma once

#include "Common.h"

// const int MAX_BUFFER_SIZE = 4096;
#define CORE_SIZE		32
#define CHANNEL_SIZE	3
#define SEARCH_SIZE		128
#define FINE_STEP		16

class Tracker {
	// double buffer[MAX_BUFFER_SIZE];
	cv::Mat patterns[CHANNEL_SIZE];
	// int update_RGB(cv::Mat frame);
	double last_score;
	cv::Rect last_hit;

	bool valid_last_hit();
public:
	Tracker();

	int tracker_update(cv::Mat frame);

	int get_target(cv::Rect &roi, double &score);

	double get_score(cv::Mat target, int channel);
};

